#include<bits/stdc++.h>
using namespace std;
int n,a[100005],cnt[100005],pre,ans;

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",a+i),cnt[a[i]]++;
    for(int i=1;i<=100000;i++){
        int t=min(pre,cnt[i]);
        ans+=t;
        pre+=cnt[i]-t;
    }
    printf("%d",n-ans);
    return 0;
}
